package com.springboot.springbootswagger.controller;

import com.springboot.springbootswagger.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

/**
 * @author wangning
 * @create 2021-03-31 17:35
 */
@Api(tags = {"用户管理"})
@RestController
@RequestMapping("/user")
public class UserController {

	@PostMapping("/saveUser")
	@ApiOperation(value = "用户新增", notes = "单个用户新增")
	@PreAuthorize("hasAuthority('user:save')")
	public String saveUser(@RequestBody User user) {

		return "新增成功";
	}
	@GetMapping("getUser")
	@ApiOperation(value = "用户查询")
	public String getUser() {

		return "查询成功";
	}
}
